test-sysroot.js: set "strict mode" when sourcing libtest.sh
authorSimon McVittie <smcv@debian.org>
Sat, 11 Jun 2016 18:07:40 +0000 (19:07 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Sun, 12 Jun 2016 11:26:58 +0000 (11:26 +0000)
As with the C tests in commit 08580118, this makes sure the test
fails as soon as something goes wrong.

Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #335
Approved by: giuseppe

tests/test-sysroot.js

index 9468d2fb8f1cca82f71692f77343b97e3c500fce..7c31659dfb8cae36e17447cd5347e32aa5821c3c 100644 (file)
@@ -37,7 +37,7 @@ function libtestExec(shellCode) {
     let testdatadir = GLib.getenv("G_TEST_SRCDIR");
     let libtestPath = GLib.build_filenamev([testdatadir, 'libtest.sh'])
     let proc = GSystem.Subprocess.new_simple_argv(['bash', '-c',
-                                                  '. ' + GLib.shell_quote(libtestPath) + '; ' + shellCode],
+                                                  'set -xeuo pipefail; . ' + GLib.shell_quote(libtestPath) + '; ' + shellCode],
                                                  GSystem.SubprocessStreamDisposition.INHERIT,
                                                  GSystem.SubprocessStreamDisposition.INHERIT,
                                                  null);